package com.demo.app.entity;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.PropertySource;
import org.springframework.stereotype.Component;

import java.util.List;

/**
 * @author xg BLACK
 * @date 2022/10/3 17:31
 * description:
 */
@Component
//指定配置文件的位置。自定义的配置文件不支持yml格式，yml配置可以写在默认的application.yml中
@PropertySource("classpath:book.properties")
@ConfigurationProperties(prefix = "book")
@Data
@AllArgsConstructor
@NoArgsConstructor
public class Book {
    private String name;
    private String author;
    private Double price;
    private List<String> tags;
}
